<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app"></div>
</body>
<script src="vue.js"></script>
<!--1.引入路由插件 -->
<script src="vue-router.js"></script>
<script>
    var Login={
        template:`
        <div>
        <div> login page</div>
        </div>
        `,
    }
    //2.使用路由插件
    Vue.use(VueRouter)
    //3.创建路由对象
  var router= new VueRouter({
        //4.配置路由对象
        routes:[
            {path:'/login',name:'login',component:Login}
        ]
    })

    //模板渲染 
    new Vue({
        el:'#app',
        router,
        template:`
        <div>
            <router-view></router-view>
        </div>
     `

    })
</script>
</html>